package com.jxw.launcher;

import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Process;
import android.os.SystemClock;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;
import android.support.v4.app.ActivityCompat;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import com.jxw.constant.Constant;
import com.jxw.engine.platsign.MainActivity;
import com.jxw.gk.ControlAppReceiver;
import com.jxw.launcher.particle.ItemOnClickListener;
import com.jxw.launcher.util.ReceiverUtil;
import com.jxw.launcher.util.Util;
import com.jxw.utils.SystemPropertiesProxy;
import com.shuyu.gsyvideoplayer.player.PlayerFactory;
import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.BuglyStrategy;
import com.tencent.bugly.beta.tinker.TinkerUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.URLEncoder;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.Enumeration;
import java.util.Random;
import java.util.regex.Pattern;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import org.apache.http.cookie.ClientCookie;
import org.json.JSONException;
import org.json.JSONObject;
import tv.danmaku.ijk.media.exo2.Exo2PlayerManager;
import tv.danmaku.ijk.media.player.IjkMediaMeta;

/* loaded from: classes.dex */
public class MyApp extends MultiDexApplication {
    private static final String TAG = "MyApp";
    public static String customApk = "";
    public static Typeface customFont;
    protected static MyApp sInstance;
    private boolean canRegist;
    public String checkseriesToken;
    public boolean isOnline;
    String mMac;
    String mSeries;
    public String mToken;
    String mcpuid;
    String serial;
    public String series;
    public ItemOnClickListener mBottomBtnOnClickListener = null;
    public String apkv = "";
    private BroadcastReceiver networkReceiver = new BroadcastReceiver() { // from class: com.jxw.launcher.MyApp.1
        @Override // android.content.BroadcastReceiver
        public void onReceive(Context context, Intent intent) {
            NetworkInfo activeNetworkInfo;
            Log.d("zzj", "networkReceiver=" + intent.getAction());
            if (ReceiverUtil.ACTION_CONNECTIVITY_ACTION.equals(intent.getAction()) && (activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo()) != null && activeNetworkInfo.isConnected()) {
                Log.d("zzj", "networkReceiver=" + activeNetworkInfo.getType());
                MyApp.this.getSharedPreferences(MainActivity.PREFERENCE, 0).getString(MainActivity.CUSTOMISBN, "");
            }
        }
    };

    protected void initOnlineStudy() {
    }

    public boolean isAppProcess() {
        String proName = getProName();
        return proName != null && proName.equalsIgnoreCase(getPackageName());
    }

    public String getProName() {
        int myPid = Process.myPid();
        for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) getApplicationContext().getSystemService("activity")).getRunningAppProcesses()) {
            if (runningAppProcessInfo.pid == myPid) {
                return runningAppProcessInfo.processName;
            }
            continue;
        }
        return null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // android.support.multidex.MultiDexApplication, android.content.ContextWrapper
    public void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        MultiDex.install(this);
    }

    @Override // android.app.Application
    public void onCreate() {
        super.onCreate();
        if (isAppProcess()) {
            Constant.setPlatFormType();
            sInstance = this;
            this.mBottomBtnOnClickListener = new ItemOnClickListener(this);
            this.canRegist = true;
            BuglyStrategy buglyStrategy = new BuglyStrategy();
            buglyStrategy.setAppChannel("jxwgb_Launcher_zndzgkptv5");
            buglyStrategy.setDeviceID(Build.SERIAL);
            Bugly.init(getApplicationContext(), "98144a2e89", false, buglyStrategy);
            registerReceiver(this.networkReceiver, new IntentFilter(ReceiverUtil.ACTION_CONNECTIVITY_ACTION));
            initOnlineStudy();
            PlayerFactory.setPlayManager(Exo2PlayerManager.class);
            GSYVideoType.setShowType(-4);
            try {
                ControlAppReceiver.init(this);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    @Override // android.app.Application
    public void onTerminate() {
        super.onTerminate();
        ControlAppReceiver.destroy();
    }

    @Override // android.app.Application, android.content.ComponentCallbacks
    public void onLowMemory() {
        super.onLowMemory();
        System.gc();
    }

    public static MyApp getInstance() {
        return sInstance;
    }

    public String getProcessName1() {
        int myPid = Process.myPid();
        for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : ((ActivityManager) getApplicationContext().getSystemService("activity")).getRunningAppProcesses()) {
            if (runningAppProcessInfo.pid == myPid) {
                return runningAppProcessInfo.processName;
            }
            continue;
        }
        return null;
    }

    private byte[] genrateKey() {
        Random random = new Random(SystemClock.elapsedRealtime());
        byte[] bArr = new byte[16];
        for (int i = 0; i < bArr.length; i++) {
            bArr[i] = (byte) random.nextInt(256);
        }
        return bArr;
    }

    private void encodeXor(byte[] bArr, byte[] bArr2) {
        int length = bArr2.length;
        for (int i = 0; i < bArr.length; i++) {
            bArr[i] = (byte) (bArr[i] ^ bArr2[i % length]);
        }
    }

    private byte[] encodeRSA(byte[] bArr) {
        try {
            Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding");
            cipher.init(1, KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(Base64.decode("MDwwDQYJKoZIhvcNAQEBBQADKwAwKAIhAMRl646CuwCkA+kU3dvp5slwT7thqDGlKi6ar83bcMRzAgMBAAE=", 0))));
            return cipher.doFinal(bArr);
        } catch (InvalidKeyException e) {
            e.printStackTrace();
            return null;
        } catch (NoSuchAlgorithmException e2) {
            e2.printStackTrace();
            return null;
        } catch (InvalidKeySpecException e3) {
            e3.printStackTrace();
            return null;
        } catch (BadPaddingException e4) {
            e4.printStackTrace();
            return null;
        } catch (IllegalBlockSizeException e5) {
            e5.printStackTrace();
            return null;
        } catch (NoSuchPaddingException e6) {
            e6.printStackTrace();
            return null;
        }
    }

    private static String getRemoteRequest(String str) {
        try {
            return new OkHttpClient().newCall(new Request.Builder().url(str).build()).execute().body().string();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public String getDeviceSerialx() {
        String str = SystemPropertiesProxy.get(this, "ro.serialno");
        if (TextUtils.isEmpty(str)) {
            try {
                if (Build.VERSION.SDK_INT >= 29) {
                    str = Build.getSerial();
                } else {
                    str = Build.SERIAL;
                }
            } catch (SecurityException e) {
                e.printStackTrace();
            }
        }
        return (TextUtils.isEmpty(str) || str.length() < 8) ? SystemPropertiesProxy.get(this, "persist.sys.serialno") : str;
    }

    public String getDeviceSerial() {
        String str = com.jxw.launcher.util.SystemPropertiesProxy.get(this, "ro.serialno");
        if (TextUtils.isEmpty(str)) {
            if (Build.VERSION.SDK_INT >= 29) {
                if (ActivityCompat.checkSelfPermission(this, "android.permission.READ_PHONE_STATE") != 0 || ActivityCompat.checkSelfPermission(this, "android.permission.READ_PRIVILEGED_PHONE_STATE") != 0) {
                    return Build.SERIAL;
                }
                str = Build.getSerial();
            } else {
                str = Build.SERIAL;
            }
        }
        return (TextUtils.isEmpty(str) || str.length() < 8) ? com.jxw.launcher.util.SystemPropertiesProxy.get(this, "persist.sys.serialno") : str;
    }

    public String getDeviceSerial_LHCX() {
        String str = SystemPropertiesProxy.get(this, "ro.serialno");
        try {
            if (TextUtils.isEmpty(str)) {
                if (Build.VERSION.SDK_INT >= 29) {
                    str = Build.getSerial();
                } else {
                    str = Build.SERIAL;
                }
            }
            return (TextUtils.isEmpty(str) || str.length() < 8) ? SystemPropertiesProxy.get(this, "persist.sys.serialno") : str;
        } catch (Exception unused) {
            return str;
        }
    }

    public String get_JzyhSN() {
        String str;
        try {
            if (Build.VERSION.SDK_INT >= 28) {
                str = Build.getSerial();
            } else if (Build.VERSION.SDK_INT > 24) {
                str = Build.SERIAL;
            } else {
                Class<?> cls = Class.forName("android.os.SystemProperties");
                str = (String) cls.getMethod("get", String.class).invoke(cls, "ro.serialno");
            }
        } catch (Exception e) {
            e.printStackTrace();
            Log.e("LXH", "读取设备序列号异常：" + e.toString());
            str = "";
        }
        Log.i("LXH", "设备的SN序列号:" + str);
        return str;
    }

    public static String getDeviceInfo360(int i) {
        try {
            Class<?> cls = Class.forName("com.qiku.controlstats.ControlStatsManager");
            return (String) cls.getDeclaredMethod("getDeviceInfo", Integer.TYPE).invoke(cls.newInstance(), Integer.valueOf(i));
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public String replaceBlank(String str) {
        return str != null ? Pattern.compile("\t|\r|\n|\\s*").matcher(str).replaceAll("") : "";
    }

    public String macAddress() throws SocketException {
        Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
        String str = null;
        while (networkInterfaces.hasMoreElements()) {
            NetworkInterface nextElement = networkInterfaces.nextElement();
            byte[] hardwareAddress = nextElement.getHardwareAddress();
            if (hardwareAddress != null && hardwareAddress.length != 0) {
                StringBuilder sb = new StringBuilder();
                int length = hardwareAddress.length;
                for (int i = 0; i < length; i++) {
                    sb.append(String.format("%02x:", Byte.valueOf(hardwareAddress[i])));
                }
                if (sb.length() > 0) {
                    sb.deleteCharAt(sb.length() - 1);
                }
                String sb2 = sb.toString();
                if (nextElement.getName().equals("wlan0")) {
                    str = sb2;
                }
            }
        }
        return str;
    }

    public String getUserInfo() {
        try {
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(new File("/sys/class/mmc_host/mmc0/mmc0:0001/serial"))));
            String readLine = bufferedReader.readLine();
            bufferedReader.close();
            return readLine;
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:11:0x002c, code lost:
        r0 = r4.substring(r4.indexOf(":") + 1, r4.length()).trim();
     */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0061 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:19:0x004a -> B:37:0x005d). Please submit an issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public static java.lang.String getCPUSerial() {
        /*
            r0 = 0
            java.io.File r1 = new java.io.File     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            java.lang.String r2 = "/proc/cpuinfo"
            r1.<init>(r2)     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            java.io.FileInputStream r2 = new java.io.FileInputStream     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            r2.<init>(r1)     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            java.io.LineNumberReader r1 = new java.io.LineNumberReader     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            java.io.InputStreamReader r3 = new java.io.InputStreamReader     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            r3.<init>(r2)     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            r1.<init>(r3)     // Catch: java.lang.Throwable -> L4e java.lang.Exception -> L53
            r2 = 1
            r3 = 1
        L19:
            r4 = 100
            if (r3 >= r4) goto L45
            java.lang.String r4 = r1.readLine()     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            if (r4 == 0) goto L45
            java.lang.String r5 = "Serial"
            int r5 = r4.indexOf(r5)     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            r6 = -1
            if (r5 <= r6) goto L40
            java.lang.String r3 = ":"
            int r3 = r4.indexOf(r3)     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            int r3 = r3 + r2
            int r2 = r4.length()     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            java.lang.String r2 = r4.substring(r3, r2)     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            java.lang.String r0 = r2.trim()     // Catch: java.lang.Exception -> L43 java.lang.Throwable -> L5e
            goto L45
        L40:
            int r3 = r3 + 1
            goto L19
        L43:
            r2 = move-exception
            goto L55
        L45:
            r1.close()     // Catch: java.io.IOException -> L49
            goto L5d
        L49:
            r1 = move-exception
            r1.printStackTrace()
            goto L5d
        L4e:
            r1 = move-exception
            r7 = r1
            r1 = r0
            r0 = r7
            goto L5f
        L53:
            r2 = move-exception
            r1 = r0
        L55:
            r2.printStackTrace()     // Catch: java.lang.Throwable -> L5e
            if (r1 == 0) goto L5d
            r1.close()     // Catch: java.io.IOException -> L49
        L5d:
            return r0
        L5e:
            r0 = move-exception
        L5f:
            if (r1 == 0) goto L69
            r1.close()     // Catch: java.io.IOException -> L65
            goto L69
        L65:
            r1 = move-exception
            r1.printStackTrace()
        L69:
            goto L6b
        L6a:
            throw r0
        L6b:
            goto L6a
        */
        throw new UnsupportedOperationException("Method not decompiled: com.jxw.launcher.MyApp.getCPUSerial():java.lang.String");
    }

    /* JADX WARN: Code restructure failed: missing block: B:11:0x002e, code lost:
        r1 = r4.substring(r4.indexOf(":") + 1, r4.length());
        r0 = r1.trim();
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v0 */
    /* JADX WARN: Type inference failed for: r1v14, types: [java.lang.String] */
    /* JADX WARN: Type inference failed for: r1v16 */
    /* JADX WARN: Type inference failed for: r1v17 */
    /* JADX WARN: Type inference failed for: r1v18 */
    /* JADX WARN: Type inference failed for: r1v19 */
    /* JADX WARN: Type inference failed for: r1v2 */
    /* JADX WARN: Type inference failed for: r1v3, types: [java.io.LineNumberReader] */
    /* JADX WARN: Type inference failed for: r1v5 */
    /* JADX WARN: Type inference failed for: r1v6 */
    /* JADX WARN: Type inference failed for: r1v8 */
    /* JADX WARN: Type inference failed for: r1v9 */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x0052 -> B:41:0x0061). Please submit an issue!!! */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public static java.lang.String getRKSerial() {
        /*
            java.lang.String r0 = ""
            r1 = 0
            java.io.File r2 = new java.io.File     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            java.lang.String r3 = "/proc/rknand"
            r2.<init>(r3)     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            java.io.FileInputStream r3 = new java.io.FileInputStream     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            r3.<init>(r2)     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            java.io.LineNumberReader r2 = new java.io.LineNumberReader     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            java.io.InputStreamReader r4 = new java.io.InputStreamReader     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            r4.<init>(r3)     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            r2.<init>(r4)     // Catch: java.lang.Throwable -> L56 java.lang.Exception -> L58
            r1 = 1
            r3 = 1
        L1b:
            r4 = 100
            if (r3 >= r4) goto L4d
            java.lang.String r4 = r2.readLine()     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            if (r4 == 0) goto L4d
            java.lang.String r5 = "FLASH ID"
            int r5 = r4.indexOf(r5)     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            r6 = -1
            if (r5 <= r6) goto L42
            java.lang.String r3 = ":"
            int r3 = r4.indexOf(r3)     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            int r3 = r3 + r1
            int r1 = r4.length()     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            java.lang.String r1 = r4.substring(r3, r1)     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            java.lang.String r0 = r1.trim()     // Catch: java.lang.Throwable -> L45 java.lang.Exception -> L48
            goto L4d
        L42:
            int r3 = r3 + 1
            goto L1b
        L45:
            r0 = move-exception
            r1 = r2
            goto L62
        L48:
            r1 = move-exception
            r7 = r2
            r2 = r1
            r1 = r7
            goto L59
        L4d:
            r2.close()     // Catch: java.io.IOException -> L51
            goto L61
        L51:
            r1 = move-exception
            r1.printStackTrace()
            goto L61
        L56:
            r0 = move-exception
            goto L62
        L58:
            r2 = move-exception
        L59:
            r2.printStackTrace()     // Catch: java.lang.Throwable -> L56
            if (r1 == 0) goto L61
            r1.close()     // Catch: java.io.IOException -> L51
        L61:
            return r0
        L62:
            if (r1 == 0) goto L6c
            r1.close()     // Catch: java.io.IOException -> L68
            goto L6c
        L68:
            r1 = move-exception
            r1.printStackTrace()
        L6c:
            goto L6e
        L6d:
            throw r0
        L6e:
            goto L6d
        */
        throw new UnsupportedOperationException("Method not decompiled: com.jxw.launcher.MyApp.getRKSerial():java.lang.String");
    }

    public String register(int i, String str, String str2, String str3, String str4, String str5, String str6) {
        if (i >= 0 && str != null && !str.isEmpty()) {
            JSONObject jSONObject = new JSONObject();
            try {
                this.mMac = str2;
                if (!TextUtils.isEmpty(str2)) {
                    jSONObject.put("content", Base64.encodeToString(str2.getBytes("utf8"), 2));
                }
                jSONObject.put(ClientCookie.VERSION_ATTR, i);
                jSONObject.put(TinkerUtils.PLATFORM, str);
                jSONObject.put(MainActivity.APKISBN, "zngbgkptv5");
                jSONObject.put("extraIsbn", "zndzgkptv5");
                jSONObject.put("series", str3);
                if (!TextUtils.isEmpty(str5)) {
                    jSONObject.put("mobile", str5);
                }
                jSONObject.put(IjkMediaMeta.IJKM_KEY_TYPE, "wifi");
                if (!TextUtils.isEmpty(str4)) {
                    jSONObject.put("serial", str4);
                    this.mSeries = str4;
                } else if (!TextUtils.isEmpty(str6)) {
                    jSONObject.put("serial", str6);
                    this.mSeries = str6;
                }
                if (!TextUtils.isEmpty(str6)) {
                    jSONObject.put("cpuid", str6);
                    this.mSeries = str6;
                }
                String jSONObject2 = jSONObject.toString();
                byte[] genrateKey = genrateKey();
                byte[] encodeRSA = encodeRSA(genrateKey);
                byte[] bytes = jSONObject2.getBytes("utf8");
                encodeXor(bytes, genrateKey);
                String str7 = new String(Base64.encode(encodeRSA, 2), "utf8");
                String str8 = new String(Base64.encode(bytes, 2), "utf8");
                String str9 = Util.HOST + "/platform/platformsign.php?version=1&key=" + URLEncoder.encode(str7, "utf8") + "&sign=" + URLEncoder.encode(str8, "utf8") + "&vct=1.0";
                Log.e("url:", str9);
                Log.e("gwj:", str9);
                String remoteRequest = getRemoteRequest(str9);
                Log.e("zzj", "getRemoteRequest, result=======================:" + remoteRequest);
                return remoteRequest;
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }
        return null;
    }

    public boolean saveCertification(String str) {
        String[] split = str.split("-");
        SharedPreferences.Editor edit = getSharedPreferences(MainActivity.PREFERENCE, 0).edit();
        edit.putString(MainActivity.CERTIFICATION, split[0]);
        try {
            edit.putString(MainActivity.APKISBN, "A89S");
            edit.putString(MainActivity.CUSTOMISBN, "zndzgkptv5");
            edit.putString("registFlag", "zngbgkptv5");
            edit.putString(MainActivity.SERIS, this.mSeries);
            edit.putBoolean("isFirstIn", false);
            edit.putString("registMac", this.mMac + BuildConfig.MAIN_TYPE);
            if (split.length > 2) {
                edit.putString("series", split[2]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return edit.commit();
    }

    public String[] parseResult(String str) {
        String num;
        if (str == null || str == null || str.length() < 4) {
            return null;
        }
        String substring = str.substring(0, 4);
        if (substring.endsWith("-")) {
            num = substring.substring(0, 3);
        } else {
            num = Integer.toString(100);
        }
        return new String[]{num, str.substring(4)};
    }

    private void regist() {
        this.canRegist = false;
        new Thread(new Runnable() { // from class: com.jxw.launcher.MyApp.2
            @Override // java.lang.Runnable
            public void run() {
                MyApp myApp = MyApp.this;
                myApp.serial = myApp.getUserInfo();
                if ("".equals(MyApp.this.serial)) {
                    MyApp.this.serial = MyApp.getRKSerial();
                }
                MyApp.this.mcpuid = MyApp.getCPUSerial();
                Log.e("zzj", "serial=:" + MyApp.this.serial + ",cpuid=" + MyApp.this.mcpuid);
                if (MyApp.this.mcpuid != null && MyApp.this.mcpuid.contains("000000000000000")) {
                    MyApp.this.mcpuid = null;
                }
                String str = null;
                for (int i = 0; i < 5; i++) {
                    try {
                        str = MyApp.this.macAddress();
                    } catch (SocketException e) {
                        e.printStackTrace();
                    }
                    if (str != null) {
                        break;
                    }
                }
                String str2 = str;
                String[] strArr = {""};
                strArr[0] = MyApp.this.getDeviceSerial();
                Log.e("zzj", "s12=:" + strArr[0]);
                if (strArr[0].contains("") || strArr[0].contains("unknown")) {
                    strArr[0] = MyApp.this.getDeviceSerialx();
                    Log.e("gwj", "xxx");
                }
                Log.e("zzj", "s13=:" + strArr[0]);
                MyApp myApp2 = MyApp.this;
                String[] parseResult = MyApp.this.parseResult(myApp2.register(1, "A89S", str2, strArr[0], myApp2.serial, null, MyApp.this.mcpuid));
                if (parseResult != null) {
                    try {
                        int parseInt = Integer.parseInt(parseResult[0], 10);
                        if (parseInt >= 200 && parseInt <= 201 && MyApp.this.saveCertification(parseResult[1])) {
                            MyApp.this.sendBroadcast(new Intent("com.zzj.regist_success"));
                        }
                    } catch (NumberFormatException e2) {
                        e2.printStackTrace();
                    }
                }
                MyApp.this.canRegist = true;
            }
        }).start();
    }
}
